@extends('backstage.layout.master')
@section('title', '添加物流配置')

@section('script')
    <script type="text/javascript">
            $(function(){
                $('#overtime').keydown(function(e){
                    if(e.keyCode==13){
                        setoverlongtime();
                    }
                });
            });
            function sendOrder(){
                swal({
                    title:"确认发货吗？",
                    text:"",
                    type:"warning",
                    showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    confirmButtonText: "确定",
                    cancelButtonText:"取消",
                    closeOnConfirm: false,
                    closeOnCancel: true
                },function(){
                    var order_express_id= $("#order_express_id").val();
                    var order_id        = $("#order_id").val();
                    var express_id      = $("#express_id option:selected").val();
                    if(order_express_id==''||order_express_id==undefined){
                        swal('请输入快递单号','','warning');
                        return;
                    }
                    $.ajax({
                        url:"/backstage/order/upd-order-express",
                        type:"post",
                        data:{"order_express_id":order_express_id,"order_id":order_id,"express_id":express_id},
                        datatype:'json',
                        success:function(re){
                            if(re.state=="M00000"){
                                swal(re.message,'','success');
                                return;
                            }
                            swal(re.message,'','warning');
                            return;
                        },
                        error:function(){
                            swal('系统繁忙','请稍后重试','warning');return;
                        }
                    });
                });
            }
    </script>
@stop

@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="#">主页</a>
            </li>

            <li class="active">
                <a href="/backstage/order/showaddexpress">订单发货</a>
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        订单发货
                        <small>
                            <i class="icon-double-angle-right"></i>
                            添加订单快递信息
                        </small>
                    </h1>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="page-content">
                            <div class="page-header preview-header">
                                <h1>
                                    添加订单快递信息
                                </h1>
                            </div><!-- /.page-header -->

                            <div class="form-horizontal">

                                <div class="form-group {{$errors->first('title')!=''?'has-error':''}}">
                                    <label class="col-sm-4 control-label no-padding-right" for="form-field-1"> 订单编号 </label>
                                    <div class="col-sm-4">
                                        <input type="text" class="width-80" id="order_id">
                                    </div>
                                </div>

                                <div class="form-group {{$errors->first('title')!=''?'has-error':''}}">
                                    <label class="col-sm-4 control-label no-padding-right" for="form-field-1"> 快递单号 </label>
                                    <div class="col-sm-4">
                                        <input type="text" class="width-80" id="order_express_id">
                                    </div>
                                </div>
                                <div class="form-group {{$errors->first('title')!=''?'has-error':''}}">
                                    <label class="col-sm-4 control-label no-padding-right" for="form-field-1"> 快递名称 </label>
                                    <div id="plat" class="col-sm-4">
                                        <select name="select" id="express_id" class="xla_k">
                                            @if(isset($express))
                                            @foreach($express as $exp)
                                            <option value ="{{$exp->express_id}}">{{$exp->express_name}}</option>
                                            @endforeach
                                            @endif
                                        </select>
                                    </div>
                                </div>

                            </div>
                            <div class="clearfix form-actions"  >
                                <div class="col-md-offset-5 col-md-9">
                                    <button class="btn btn-info" onclick="sendOrder();">
                                        <i class="icon-ok bigger-110"></i>
                                        发货
                                    </button>
                                </div>
                            </div>


                        </div><!-- /page-content -->
                    </div><!-- col -->
                </div><!-- row -->
            </div><!-- col -->
        </div><!-- row -->
    </div><!-- /.page-content -->

@stop
@section('script')
    <script src="backstage/assets/js/jquery.colorbox-min.js"></script>
@stop
